﻿using CustomModel;
using Microsoft.Practices.Prism.ViewModel;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace HeyPiPi_Desk.Models
{
    public class MainMenuModel : NotificationObject
    {
        private string _name;

        /// <summary>
        /// 当前节点的名字
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; this.RaisePropertyChanged(() => this.Name); }
        }
        private ObservableCollection<ChildMenu> _childMenus;
        /// <summary>
        /// 子菜单的名字
        /// </summary>
        public ObservableCollection<ChildMenu> ChildMenus
        {
            get { return _childMenus; }
            set { _childMenus = value; this.RaisePropertyChanged(() => this.ChildMenus); }
        }
    }

    public class ChildMenu : NotificationObject
    {
        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; this.RaisePropertyChanged(() => this.Name); }
        }

    }



    /// <summary>
    /// 创建菜单
    /// </summary>
    public class CreateMenu
    {
        private static CreateMenu _instance;

        private CreateMenu()
        {

        }

        /// <summary>
        /// 获得实例对象
        /// </summary>
        /// <returns></returns>
        public static CreateMenu GetInstance()
        {
            if (_instance == null)
            {
                _instance = new CreateMenu();
            }
            return _instance;
        }

        private ObservableCollection<MainMenuModel> Menus { get; set; }

        /// <summary>
        /// 装备菜单 不需要权限 验证，全部放权
        /// </summary>
        /// <returns></returns>

        private ObservableCollection<MainMenuModel> RigMenus()
        {
            if (Menus == null)
            {
                Menus = new ObservableCollection<MainMenuModel>();

                MainMenuModel home = new MainMenuModel();
                home.Name = "主页";

                Menus.Add(home);

                MainMenuModel paycenter = new MainMenuModel();
                paycenter.Name = "支付中心";
                paycenter.ChildMenus = new ObservableCollection<ChildMenu>()
                {

                    new ChildMenu { Name = "快速收银" },
                    new ChildMenu { Name = "自定义收银" },
                    new ChildMenu { Name = "挂单" }
                       };

                Menus.Add(paycenter);
                MainMenuModel wcvipcenter = new MainMenuModel();
                wcvipcenter.Name = "微信会员中心";

                wcvipcenter.ChildMenus = new ObservableCollection<ChildMenu>() {
                    new ChildMenu{Name="微信设置"},
                    new ChildMenu{Name="微信预约"}
                };

                Menus.Add(wcvipcenter);

                MainMenuModel vipcenter = new MainMenuModel();
                vipcenter.Name = "会员中心";
                vipcenter.ChildMenus = new ObservableCollection<ChildMenu>()
                {
                    new ChildMenu{ Name="会员列表"},
                    new ChildMenu{Name="会员办卡"},
                    new ChildMenu{Name="会员等级管理"},
                    new ChildMenu{Name="礼品管理"},
                    new ChildMenu{Name="积分记录"},
                    new ChildMenu{Name="还款记录"}
                };

                Menus.Add(vipcenter);
                MainMenuModel servicecenter = new MainMenuModel();
                servicecenter.Name = "服务中心";
                servicecenter.ChildMenus = new ObservableCollection<ChildMenu>
                {
                    new ChildMenu{Name="服务项目管理"},
                    new ChildMenu{Name="服务分类管理"}
                };

                Menus.Add(servicecenter);

                MainMenuModel countcard = new MainMenuModel();
                countcard.Name = "次卡管理中心";
                countcard.ChildMenus = new ObservableCollection<ChildMenu>
                {
                    new ChildMenu{Name="次卡列表"},
                    new ChildMenu{Name="已售次卡"}
                };

                Menus.Add(countcard);
                MainMenuModel productcenter = new MainMenuModel();
                productcenter.Name = "商品管理中心";
                productcenter.ChildMenus = new ObservableCollection<ChildMenu>
                {
                    new ChildMenu{Name="商品列表"},
                    new ChildMenu{Name="商品分类"},
                    new ChildMenu{Name="商品单位"},
                    new ChildMenu{Name="入库记录"},
                    new ChildMenu{Name="出库记录"}
                };

                Menus.Add(productcenter);
                MainMenuModel assistantcenter = new MainMenuModel();
                assistantcenter.Name = "员工管理中心";
                assistantcenter.ChildMenus = new ObservableCollection<ChildMenu>
                {
                    new ChildMenu{Name="员工列表"},
                    new ChildMenu{Name="职位管理"},
                    new ChildMenu{Name="员工提成详情"},
                    new ChildMenu{Name="员工业绩详情"}
                };

                Menus.Add(assistantcenter);
                MainMenuModel deduct = new MainMenuModel();
                deduct.Name = "提成设置中心";
                deduct.ChildMenus = new ObservableCollection<ChildMenu>
                {
                                new ChildMenu{Name="服务提成设置"},
                                new ChildMenu{Name="商品销售设置"},
                                new ChildMenu{Name="开卡/续费设置"},
                                new ChildMenu{Name="次卡办理设置"},
                                new ChildMenu{Name="次卡消费设置"}
                };

                Menus.Add(deduct);

                MainMenuModel doingdetail = new MainMenuModel();
                doingdetail.Name = "营业详情";

                doingdetail.ChildMenus = new ObservableCollection<ChildMenu> {
                    new ChildMenu{ Name="客户消费明细"},
                    new ChildMenu{Name="会员办卡明细"},
                    new ChildMenu{Name="次卡销售明细"},
                    new ChildMenu{Name="会员续费明细"}
                };


                Menus.Add(doingdetail);
                MainMenuModel moneycollection = new MainMenuModel();
                moneycollection.Name = "财务报表";
                moneycollection.ChildMenus = new ObservableCollection<ChildMenu>
                {
                    new ChildMenu{Name="店铺财务总表"},
                    new ChildMenu{Name="项目销售报表"},
                    new ChildMenu{Name="商品销售报表"},
                    new ChildMenu{Name="会员办卡报表"},
                    new ChildMenu{Name="会员续费报表"}

                };

                Menus.Add(moneycollection);
                MainMenuModel commonbalance = new MainMenuModel();
                commonbalance.Name = "日常收支";
                commonbalance.ChildMenus = new ObservableCollection<ChildMenu>()
                {
                    new ChildMenu{Name="收支列表"},
                    new ChildMenu{Name="添加收支"}
                };

                Menus.Add(commonbalance);
            }

            //配置权限 


            return Menus;
        }

        /// <summary>
        /// 根据权限列表装备权限列表树
        /// </summary>
        /// <param name="authorityList"></param>
        /// <returns></returns>
        public ObservableCollection<ShopAuthorityModel> GetAuthorityGroupModelList(List<string> authorityList)
        {

            ObservableCollection<ShopAuthorityModel> model = new ObservableCollection<ShopAuthorityModel>();


            {

                //支付中心  1
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "支付中心";
                item.Id = 1;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("支付中心");
                model.Add(item);

                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;

                var item1 = new ShopAuthorityModel();
                item1.Name = "快速收银";
                item1.Id = 2;
                item1.Pid = 1;
                item1.IsChecked = authorityList.Contains("快速收银");
                child.Add(item1);

                var item2 = new ShopAuthorityModel();
                item2.Name = "自定义收银";
                item2.Id = 3;
                item2.Pid = 1;
                item2.IsChecked = authorityList.Contains("自定义收银");
                child.Add(item2);


                var item3 = new ShopAuthorityModel();
                item3.Name = "挂单";
                item3.Id = 4;
                item3.Pid = 1;
                item3.IsChecked = authorityList.Contains("挂单");
                child.Add(item3);
            }

            {

                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "微信会员中心";
                item.Id = 5;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("微信会员中心");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "微信设置";
                item1.Id = 6;
                item1.Pid = 5;
                item1.IsChecked = authorityList.Contains("微信设置");
                child.Add(item1);

                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "微信预约";
                item2.Id = 7;
                item2.Pid = 5;
                item2.IsChecked = authorityList.Contains("微信预约");
                child.Add(item2);



            }


            {
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "会员中心";
                item.Id = 8;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("会员中心");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "会员列表";
                item1.Id = 9;
                item1.Pid = 8;
                item1.IsChecked = authorityList.Contains("会员列表");
                child.Add(item1);

                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "会员办卡";
                item2.Id = 10;
                item2.Pid = 8;
                item2.IsChecked = authorityList.Contains("会员办卡");
                child.Add(item2);

                ShopAuthorityModel item4 = new ShopAuthorityModel();
                item4.Name = "会员等级管理";
                item4.Id = 11;
                item4.Pid = 8;
                item4.IsChecked = authorityList.Contains("会员等级管理");
                child.Add(item4);

                ShopAuthorityModel item5 = new ShopAuthorityModel();
                item5.Name = "会员等级管理";
                item5.Id = 12;
                item5.Pid = 8;
                item5.IsChecked = authorityList.Contains("会员等级管理");
                child.Add(item5);

                ShopAuthorityModel item6 = new ShopAuthorityModel();
                item6.Name = "礼品管理";
                item6.Id = 13;
                item6.Pid = 8;
                item6.IsChecked = authorityList.Contains("礼品管理");
                child.Add(item6);

                ShopAuthorityModel item7 = new ShopAuthorityModel();
                item7.Name = "积分记录";
                item7.Id = 14;
                item7.Pid = 8;
                item7.IsChecked = authorityList.Contains("积分记录");
                child.Add(item7);

                ShopAuthorityModel item8 = new ShopAuthorityModel();
                item8.Name = "还款记录";
                item8.Id = 15;
                item8.Pid = 8;
                item8.IsChecked = authorityList.Contains("还款记录");
                child.Add(item8);

            }
            {
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "服务中心";
                item.Id = 16;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("服务中心");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "服务项目管理";
                item1.Id = 17;
                item1.Pid = 16;
                item1.IsChecked = authorityList.Contains("服务项目管理");
                child.Add(item1);

                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "服务分类管理";
                item2.Id = 18;
                item2.Pid = 16;
                item2.IsChecked = authorityList.Contains("服务分类管理");
                child.Add(item2);

            }

            {
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "次卡管理中心";
                item.Id = 19;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("次卡管理中心");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "次卡列表";
                item1.Id = 20;
                item1.Pid = 19;
                item1.IsChecked = authorityList.Contains("次卡列表");
                child.Add(item1);

                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "已售次卡";
                item2.Id = 21;
                item2.Pid = 19;
                item2.IsChecked = authorityList.Contains("已售次卡");
                child.Add(item2);

            }

            {
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "员工管理中心";
                item.Id = 22;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("员工管理中心");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "员工列表";
                item1.Id = 23;
                item1.Pid = 22;
                item1.IsChecked = authorityList.Contains("员工列表");
                child.Add(item1);

                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "职位管理";
                item2.Id = 24;
                item2.Pid = 22;
                item2.IsChecked = authorityList.Contains("职位管理");
                child.Add(item2);


                ShopAuthorityModel item3 = new ShopAuthorityModel();
                item3.Name = "员工提成详情";
                item3.Id = 25;
                item3.Pid = 22;
                item3.IsChecked = authorityList.Contains("员工提成详情");
                child.Add(item3);

                ShopAuthorityModel item4 = new ShopAuthorityModel();
                item4.Name = "员工业绩详情";
                item4.Id = 26;
                item4.Pid = 22;
                item4.IsChecked = authorityList.Contains("员工业绩详情");
                child.Add(item4);


            }

            {
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "提成设置中心";
                item.Id = 27;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("提成设置中心");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "服务提成设置";
                item1.Id = 28;
                item1.Pid = 27;
                item1.IsChecked = authorityList.Contains("服务提成设置");
                child.Add(item1);

                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "商品销售设置";
                item2.Id = 29;
                item2.Pid = 27;
                item2.IsChecked = authorityList.Contains("商品销售设置");
                child.Add(item2);

                ShopAuthorityModel item3 = new ShopAuthorityModel();
                item3.Name = "开卡/续费设置";
                item3.Id = 30;
                item3.Pid = 27;
                item3.IsChecked = authorityList.Contains("开卡/续费设置");
                child.Add(item3);

                ShopAuthorityModel item4 = new ShopAuthorityModel();
                item4.Name = "次卡办理设置";
                item4.Id = 31;
                item4.Pid = 27;
                item4.IsChecked = authorityList.Contains("次卡办理设置");
                child.Add(item4);

                ShopAuthorityModel item5 = new ShopAuthorityModel();
                item5.Name = "次卡消费设置";
                item5.Id = 32;
                item5.Pid = 27;
                item5.IsChecked = authorityList.Contains("次卡消费设置");
                child.Add(item5);

            }

            {

                ShopAuthorityModel item= new ShopAuthorityModel();
                item.Name = "营业详情";
                item.Id = 33;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("营业详情");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "客户消费明细";
                item1.Id = 34;
                item1.Pid = 33;
                item1.IsChecked = authorityList.Contains("客户消费明细");
                child.Add(item1);


                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "会员办卡明细";
                item2.Id = 35;
                item2.Pid = 33;
                item2.IsChecked = authorityList.Contains("会员办卡明细");
                child.Add(item2);

                ShopAuthorityModel item3 = new ShopAuthorityModel();
                item3.Name = "次卡销售明细";
                item3.Id = 35;
                item3.Pid = 33;
                item3.IsChecked = authorityList.Contains("次卡销售明细");
                child.Add(item3);

                ShopAuthorityModel item4= new ShopAuthorityModel();
                item4.Name = "会员续费明细";
                item4.Id = 35;
                item4.Pid = 33;
                item4.IsChecked = authorityList.Contains("会员续费明细");
                child.Add(item4);


            }


            {
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "财务报表";
                item.Id = 36;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("财务报表");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "项目销售报表";
                item1.Id = 37;
                item1.Pid = 36;
                item1.IsChecked = authorityList.Contains("项目销售报表");
                child.Add(item1);


                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "会员办卡报表";
                item2.Id = 38;
                item2.Pid = 36;
                item2.IsChecked = authorityList.Contains("会员办卡报表");
                child.Add(item2);

                ShopAuthorityModel item3 = new ShopAuthorityModel();
                item3.Name = "会员续费报表";
                item3.Id = 38;
                item3.Pid = 36;
                item3.IsChecked = authorityList.Contains("会员续费报表");
                child.Add(item3);
            }

            {
                ShopAuthorityModel item = new ShopAuthorityModel();
                item.Name = "日常收支";
                item.Id = 39;
                item.Pid = null;
                item.IsChecked = authorityList.Contains("日常收支");
                model.Add(item);
                ObservableCollection<ShopAuthorityModel> child = new ObservableCollection<ShopAuthorityModel>();
                item.ChildMenu = child;
                ShopAuthorityModel item1 = new ShopAuthorityModel();
                item1.Name = "收支列表";
                item1.Id = 40;
                item1.Pid = 39;
                item1.IsChecked = authorityList.Contains("收支列表");
                child.Add(item1);

                ShopAuthorityModel item2 = new ShopAuthorityModel();
                item2.Name = "添加收支";
                item2.Id = 41;
                item2.Pid = 39;
                item2.IsChecked = authorityList.Contains("添加收支");
                child.Add(item2);

            }

            return model;

        }

        /// <summary>
        /// 装备菜单
        /// </summary>
        /// <returns></returns>
        private ObservableCollection<MainMenuModel> RigMenus(List<string> priv_list)
        {


            if (Menus == null)
            {
                Menus = new ObservableCollection<MainMenuModel>();

                MainMenuModel home = new MainMenuModel();
                home.Name = "主页";

                Menus.Add(home);

                MainMenuModel paycenter = new MainMenuModel();

                if (priv_list.Contains("支付中心"))
                {
                    paycenter.Name = "支付中心";
                    paycenter.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("快速收银"))
                    {
                        paycenter.ChildMenus.Add(new ChildMenu { Name = "快速收银" });
                    }
                    if (priv_list.Contains("自定义收银"))
                    {
                        paycenter.ChildMenus.Add(new ChildMenu { Name = "自定义收银" });
                    }
                    if (priv_list.Contains("挂单"))
                    {
                        paycenter.ChildMenus.Add(new ChildMenu { Name = "挂单" });
                    }
                    Menus.Add(paycenter);
                }


                if (priv_list.Contains("微信会员中心"))
                {
                    MainMenuModel wcvipcenter = new MainMenuModel();
                    wcvipcenter.Name = "微信会员中心";
                    wcvipcenter.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("微信设置"))
                    {
                        wcvipcenter.ChildMenus.Add(new ChildMenu { Name = "微信设置" });
                    }
                    if (priv_list.Contains("微信预约"))
                    {
                        wcvipcenter.ChildMenus.Add(new ChildMenu { Name = "微信预约" });
                    }
                    Menus.Add(wcvipcenter);
                }


                if (priv_list.Contains("会员中心"))
                {
                    MainMenuModel vipcenter = new MainMenuModel();
                    vipcenter.Name = "会员中心";
                    vipcenter.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("会员列表"))
                    {
                        vipcenter.ChildMenus.Add(new ChildMenu { Name = "会员列表" });

                    }
                    if (priv_list.Contains("会员办卡"))
                    {
                        vipcenter.ChildMenus.Add(new ChildMenu { Name = "会员办卡" });

                    }
                    if (priv_list.Contains("会员等级管理"))
                    {
                        vipcenter.ChildMenus.Add(new ChildMenu { Name = "会员等级管理" });

                    }
                    if (priv_list.Contains("礼品管理"))
                    {
                        vipcenter.ChildMenus.Add(new ChildMenu { Name = "礼品管理" });

                    }
                    if (priv_list.Contains("积分记录"))
                    {
                        vipcenter.ChildMenus.Add(new ChildMenu { Name = "积分记录" });

                    }
                    if (priv_list.Contains("还款记录"))
                    {
                        vipcenter.ChildMenus.Add(new ChildMenu { Name = "还款记录" });

                    }
                    Menus.Add(vipcenter);
                }

                if (priv_list.Contains("服务中心"))
                {
                    MainMenuModel servicecenter = new MainMenuModel();
                    servicecenter.Name = "服务中心";
                    servicecenter.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("服务项目管理"))
                    {
                        servicecenter.ChildMenus.Add(new ChildMenu { Name = "服务项目管理" });
                    }
                    if (priv_list.Contains("服务分类管理"))
                    {
                        servicecenter.ChildMenus.Add(new ChildMenu { Name = "服务分类管理" });
                    }

                    Menus.Add(servicecenter);
                }

                if (priv_list.Contains("次卡管理中心"))
                {
                    MainMenuModel countcard = new MainMenuModel();
                    countcard.Name = "次卡管理中心";
                    countcard.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("次卡列表"))
                    {
                        countcard.ChildMenus.Add(new ChildMenu { Name = "次卡列表" });
                    }
                    if (priv_list.Contains("已售次卡"))
                    {
                        countcard.ChildMenus.Add(new ChildMenu { Name = "已售次卡" });
                    }
                    Menus.Add(countcard);
                }



                if (priv_list.Contains("商品管理中心"))
                {
                    MainMenuModel productcenter = new MainMenuModel();
                    productcenter.Name = "商品管理中心";
                    productcenter.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("商品列表"))
                    {
                        productcenter.ChildMenus.Add(new ChildMenu { Name = "商品列表" });
                    }
                    if (priv_list.Contains("商品列表"))
                    {
                        productcenter.ChildMenus.Add(new ChildMenu { Name = "商品分类" });
                    }
                    if (priv_list.Contains("商品单位"))
                    {
                        productcenter.ChildMenus.Add(new ChildMenu { Name = "商品单位" });
                    }
                    if (priv_list.Contains("入库记录"))
                    {
                        productcenter.ChildMenus.Add(new ChildMenu { Name = "入库记录" });
                    }
                    if (priv_list.Contains("出库记录"))
                    {
                        productcenter.ChildMenus.Add(new ChildMenu { Name = "出库记录" });
                    }
                    Menus.Add(productcenter);
                }

                if (priv_list.Contains("员工管理中心"))
                {
                    MainMenuModel assistantcenter = new MainMenuModel();
                    assistantcenter.Name = "员工管理中心";
                    assistantcenter.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("员工列表"))
                    {
                        assistantcenter.ChildMenus.Add(new ChildMenu { Name = "员工列表" });
                    }
                    if (priv_list.Contains("职位管理"))
                    {
                        assistantcenter.ChildMenus.Add(new ChildMenu { Name = "职位管理" });
                    }
                    if (priv_list.Contains("员工提成详情"))
                    {
                        assistantcenter.ChildMenus.Add(new ChildMenu { Name = "员工提成详情" });
                    }

                    if (priv_list.Contains("员工业绩详情"))
                    {
                        assistantcenter.ChildMenus.Add(new ChildMenu { Name = "员工业绩详情" });
                        Menus.Add(assistantcenter);

                    }
                }

                if (priv_list.Contains("提成设置中心"))
                {
                    MainMenuModel deduct = new MainMenuModel();
                    deduct.Name = "提成设置中心";
                    deduct.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("服务提成设置"))
                    {
                        deduct.ChildMenus.Add(new ChildMenu { Name = "服务提成设置" });
                    }
                    if (priv_list.Contains("商品销售设置"))
                    {
                        deduct.ChildMenus.Add(new ChildMenu { Name = "商品销售设置" });
                    }
                    if (priv_list.Contains("开卡/续费设置"))
                    {
                        deduct.ChildMenus.Add(new ChildMenu { Name = "开卡/续费设置" });
                    }
                    if (priv_list.Contains("次卡办理设置"))
                    {
                        deduct.ChildMenus.Add(new ChildMenu { Name = "次卡办理设置" });
                    }
                    if (priv_list.Contains("次卡消费设置"))
                    {
                        deduct.ChildMenus.Add(new ChildMenu { Name = "次卡消费设置" });
                    }
                    Menus.Add(deduct);
                }



                if (priv_list.Contains("营业详情"))
                {
                    MainMenuModel doingdetail = new MainMenuModel();
                    doingdetail.Name = "营业详情";

                    doingdetail.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("客户消费明细"))
                    {
                        doingdetail.ChildMenus.Add(new ChildMenu { Name = "客户消费明细" });
                    }
                    if (priv_list.Contains("会员办卡明细"))
                    {
                        doingdetail.ChildMenus.Add(new ChildMenu { Name = "会员办卡明细" });
                    }
                    if (priv_list.Contains("次卡销售明细"))
                    {
                        doingdetail.ChildMenus.Add(new ChildMenu { Name = "次卡销售明细" });
                    }
                    if (priv_list.Contains("会员续费明细"))
                    {
                        doingdetail.ChildMenus.Add(new ChildMenu { Name = "会员续费明细" });
                    }
                    Menus.Add(doingdetail);
                }

                if (priv_list.Contains("财务报表"))
                {
                    MainMenuModel moneycollection = new MainMenuModel();
                    moneycollection.Name = "财务报表";
                    moneycollection.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("项目销售报表"))
                    {
                        moneycollection.ChildMenus.Add(new ChildMenu { Name = "项目销售报表" });
                    }
                    if (priv_list.Contains("会员办卡报表"))
                    {
                        moneycollection.ChildMenus.Add(new ChildMenu { Name = "会员办卡报表" });
                    }
                    if (priv_list.Contains("会员续费报表"))
                    {
                        moneycollection.ChildMenus.Add(new ChildMenu { Name = "会员续费报表" });
                    }
                    Menus.Add(moneycollection);
                }

                if (priv_list.Contains("日常收支"))
                {

                    MainMenuModel commonbalance = new MainMenuModel();
                    commonbalance.Name = "日常收支";
                    commonbalance.ChildMenus = new ObservableCollection<ChildMenu>();
                    if (priv_list.Contains("收支列表"))
                    {
                        commonbalance.ChildMenus.Add(new ChildMenu { Name = "收支列表" });
                    }
                    if (priv_list.Contains("添加收支"))
                    {
                        commonbalance.ChildMenus.Add(new ChildMenu { Name = "添加收支" });
                    }
                    Menus.Add(commonbalance);
                }

            }

            //配置权限 

            return Menus;
        }




        /// <summary>
        /// 获得菜单集合
        /// <paramref name="priv_list">权限列表</paramref>
        /// </summary>
        /// <returns></returns>
        public ObservableCollection<MainMenuModel> GetMenuList(List<string> priv_list)
        {

            return RigMenus();
        }
    }
}
